Release 10.1A: OpenEdge Getting Started:
Object-oriented Programming
Using the root class — Progress.Lang.Object
Progress.Lang.Objectis a Progress built-in class definition that is the ultimate super class (root class) for all classes. In other words, if a class does not inherit from another class it implicitly inherits fromProgress.Lang.Object. Thus, at the top of every class inheritance chain is theProgress.Lang.Objectclass.Note: These data members and methods provide support for class-based objects that is similar to the support provided by the 4GL internal attributes and methods on handles to procedure-based objects.
Progress.Lang.Objectprovides a common set of data members and methods that are available for an instance of any class.Table 2–2 describes the common data members and methods on
Progress.Lang.Object.
Table 2–2: Progress.Lang.Object public data members and methods Data member or method Description A read-only data member that contains an object reference to the next object in the linked list of instantiated objects for the session. This data member is critical to the function of a Progress session and cannot be overridden. You use this data member together with theFIRST-OBJECTattribute on theSESSIONsystem handle in order to walk the list from the first to the last instantiated object. A read-only data member that contains an object reference to the previous object in the linked list of instantiated objects for the session. This data member is critical to the function of a Progress session and cannot be overridden.You use this data member together with theLAST-OBJECTattribute on theSESSIONsystem handle in order to walk the list from the last to the first instantiated object. Constructor for this class. You can instantiateProgress.Lang.Object, but its functionality is limited to the public data members and methods defined in this table. This class is normally used to define a variable or parameter that can represent any class-based object in the 4GL (because all class-based objects inherit fromProgress.Lang.Object). Returns an object reference to a built-in instance ofProgress.Lang.Classthat provides type information for the current class instance. Each Progress session contains a single instance ofProgress.Lang.Classfor each type of class-based object created in the session. The lifetime of this built-in object is controlled by the Progress session and therefore cannot be deleted. For more information on the built-in class,Progress.Lang.Class, see the "Reflection — using the Progress.Lang.Class class" section. Returns the type name of the object followed by a unique object identifier in the Progress session. This method is normally overridden by a subclass. Has no default behavior and returns the Unknown value (Note: Use the equals operator (?) and an error message if it is invoked and not overridden by a subclass. The subclass should define a method to determine if two different object references are equivalent and returnTRUEorFALSEdepending on the result. The two objects to compare are the current object instance and the object instance referenced byother-obj.EQor=) to determine if the two object reference point to the same object. Has no default behavior and returns the Unknown value (?) and an error message if it is invoked and not overridden by a subclass. The subclass should define a method to create a copy of an object and return a reference to the new copy.
Because every object ultimately derives from
Progress.Lang.Object, you can define an object reference with the data typeProgress.Lang.Objectand set it to reference any class-based object that you create in a Progress session. As with any object reference, the use of aProgress.Lang.Objectobject reference is limited to the data members and methods defined forProgress.Lang.Object. However, you can cast any object reference to an appropriate subclass to access functionality in that subclass. For more information on casting, see the "Assignment and the CAST function" section
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |